package com.fili.gui;

import com.fili.gui.components.graph.GraphPanel;
import com.fili.gui.components.table.TablePanel;
import com.fili.gui.components.date_time.TimeChooser;
import com.fili.gui.components.date_time.DateChooser;
import com.fili.gui.dialogs.config.ConfigDialog;
import com.fili.core.storage.DataStore;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 19, 2006
 * Time: 10:34:46 PM
 */
public class DryMainFrame extends JFrame
{
    private ActionsEngine actionsEngine;
    private JTabbedPane tabbedPane;

    public DryMainFrame()
    {
        super("Dry");

        actionsEngine = new ActionsEngine(this);
        DryMainFrameActions.setupActions(actionsEngine);

        setLayout(new BorderLayout());
        setSize(600, 400);
        setDefaultCloseOperation(EXIT_ON_CLOSE);

        tabbedPane = new JTabbedPane();
        add(tabbedPane, BorderLayout.CENTER);

        JMenuBar mb = new JMenuBar();

        JMenu m = new JMenu("File");
        m.add(actionsEngine.getAction(DryMainFrameActions.ACTION_FILE_SETTINGS));
        m.add(actionsEngine.getAction(DryMainFrameActions.ACTION_FILE_EXIT));

        mb.add(m);
        setJMenuBar(mb);

        tabbedPane.add("Sonde", new DateChooser());
        tabbedPane.add("Tabel", new TablePanel(new DataStore(0)));
        tabbedPane.add("Grafic", new GraphPanel(null));

        setVisible(true);
        setExtendedState(MAXIMIZED_BOTH);
    }

    public void do_ACTION_FILE_SETTINGS()
    {
        new ConfigDialog(this);
    }

    public void do_ACTION_FILE_EXIT()
    {
    }

    public void do_ACTION_VIEW_SHOW()
    {
    }

    public void do_ACTION_VIEW_HIDE()
    {
    }
}
